Mule : Stream Provider
This page last changed on Oct 30, 2006 by [email protected].
The Stream Provider allows the reading and writing of streaming data. Typically, this is used as the interface to Java's System.out and System.in objects for debugging via the System Stream Provider. A typically use of the System Stream Provider for getting data via System.in is like this: <mule-descriptor name="test" implementation="org.mule.components.simple.PassThroughComponent"> <inbound-router> <endpoint address="stream://System.in?promptMessage=Enter something: /> </inbound-router> </mule-descriptor> Note that no <connector> definition is required per se: use of the stream endpoint tells Mule to use the SystemStreamConnector. However, if you need to define it explicitly, you can do so like this: <connector name="SystemStreamConnector" className="org.mule.providers.stream.SystemStreamConnector"> <properties> <property name="promptMessage" value="Enter something: "/> <property name="messageDelayTime" value="1000"/> </properties> </connector> A typically use of the System Stream Provider for sending data to the console via System.out is like this: <outbound-router> <router className="org.mule.routing.outbound.OutboundPassThroughRouter"> <endpoint address="stream://System.out" transformers="JMSMessageToObject"/> </router> </outbound-router> In this example, the output is a JMS message which is sent to System.out. The transformer converts the JMS message to something readable. Stream Connector PropertiesThe following properties are defined for this connector:
Stream EndpointsSystem Stream endpoints are defined using this syntax: stream://[stream name]
"stream name" can be one of:
Property OverridesYou can override certain properties when defining a System Stream endpoint to control the way that particular receiver or dispatcher behaves. The properties that can be set on the individual endpoint are promptMessage and outputMessage. TransformersThere are no built-in transformers for the Stream Provider. |
Document generated by Confluence on Nov 27, 2006 10:27 |